﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UserRoles.aspx.cs" Inherits="CoolCode.Web.UI.Views.Admin.UserRoles" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>角色管理</title>
</head>
<body>
    <form id="form1" runat="server">
    <ajaxToolkit:ToolkitScriptManager ID="tsmAjax" runat="server">
        <Scripts>
            <asp:ScriptReference Path="~/Content/js/Common.js" />
        </Scripts>
    </ajaxToolkit:ToolkitScriptManager>
    <cc:Loading ID="Loading1" runat="server"></cc:Loading>
    <!--Title -->
    <div class="HeaderTitle">
        <asp:Label ID="SCRHDR" runat="server" Text="角色管理"></asp:Label>
    </div>
    <asp:Panel ID="pnlMaster" runat="server" CssClass="HeaderSearch">
        <table cellspacing="5" width="100%">
            <tr>
                <td align="right" style="width: 80px; min-width: 80px;">
                    <asp:Label ID="lblUser" runat="server" Text="角色"></asp:Label>
                </td>
                <td align="left">
                    <asp:UpdatePanel ID="udpRole" runat="server" UpdateMode="Conditional" >
                        <ContentTemplate>
                            <asp:TextBox ID="txtRole" runat="server" CssClass="FlatTextBox" Width="200px" AutoPostBack="true"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RoleRequired" runat="server" ControlToValidate="txtRole"
                        ErrorMessage="*不能为空" ></asp:RequiredFieldValidator>
                    <ajaxToolkit:AutoCompleteExtender ID="aceSearchSuggest" runat="server" SkinID="Suggest"
                        TargetControlID="txtRole" ServicePath="~/WebServices/UserService.asmx" ServiceMethod="ListRoles" />
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </td>
            </tr>
        </table>
    </asp:Panel>
    <!--Grid-->
    <asp:UpdatePanel ID="udpHeader" runat="server" UpdateMode="Conditional" >
        <ContentTemplate>
            <div class="HeaderToolbar">
                <asp:LinkButton ID="lnkSave" runat="server"  Text="保存" CausesValidation="true" />
                &nbsp; 
                <asp:LinkButton ID="lnkDelete" runat="server"  Text="删除" CausesValidation="true"   OnClientClick="if(!confirm('你确认要删除吗？'))return false;"/>
                &nbsp; 
                <a href="#" onclick="refresh();">刷新</a>&nbsp;
            </div>
            <div class="HeaderGridView">
                <asp:GridView ID="gvMaster" runat="server" SkinID="gvMaster" DataKeyNames="MenuID,BelongTo">
                    <Columns>
                        <asp:BoundField DataField="MenuID" Visible="false" />
                        <asp:BoundField DataField="BelongTo" Visible="false" />
                        <asp:BoundField DataField="MenuDesc" ItemStyle-Width="150px" HeaderText ="功能描述" />
                        <asp:TemplateField ItemStyle-Width="80px" ItemStyle-HorizontalAlign="Center">
                            <HeaderTemplate>
                                <asp:CheckBox ID="chkReadSelectAll" ToolTip="选择所有" runat="server" />可读</HeaderTemplate>
                            <ItemTemplate>
                                <asp:CheckBox ID="chkRead" runat="server" Checked='<%#Eval("CanRead") %>' /></ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField ItemStyle-Width="80px" ItemStyle-HorizontalAlign="Center">
                            <HeaderTemplate>
                                <asp:CheckBox ID="chkWriteSelectAll" ToolTip="选择所有" runat="server" />可写</HeaderTemplate>
                            <ItemTemplate>
                                <asp:CheckBox ID="chkWrite" runat="server" Checked='<%#Eval("CanWrite") %>' /></ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField ItemStyle-Width="80px" ItemStyle-HorizontalAlign="Center">
                            <HeaderTemplate>
                                <asp:CheckBox ID="chkDeleteSelectAll" ToolTip="选择所有" runat="server" />可删</HeaderTemplate>
                            <ItemTemplate>
                                <asp:CheckBox ID="chkDelete" runat="server" Checked='<%#Eval("CanDelete") %>' /></ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField ItemStyle-Width="100px" ItemStyle-HorizontalAlign="Center">
                            <HeaderTemplate>
                                <asp:CheckBox ID="chkExportSelectAll" ToolTip="选择所有" runat="server" />可导出数据</HeaderTemplate>
                            <ItemTemplate>
                                <asp:CheckBox ID="chkExport" runat="server" Checked='<%#Eval("CanExport") %>' /></ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <EmptyDataTemplate>
                        <cc:EmptyData ID="EmptyData1" runat="server"></cc:EmptyData>
                    </EmptyDataTemplate>
                </asp:GridView>
            </div>
            <div style="clear: both;">
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    </form>
</body>
</html>
